package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import view.Home;

public class ViewProductController implements ActionListener {

	private Home home;

	public ViewProductController(Home home) {
		this.home = home;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		changeHome();
	}

	private void changeHome() {
		home.getpnHome().remove(home.getPnHomeCurrent());
		home.setPnHomeCurrent(home.getPnProView());
		home.getpnHome().add(home.getPnHomeCurrent());
		home.getPnHomeCurrent().setBounds(0, 0, home.getpnHome().getWidth(),
				home.getpnHome().getHeight());
		home.getpnHome().updateUI();
	}

}
